
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

project(intro LANGUAGES C)

include_directories(../common)

set(COMPILE_ALL OFF)

list(APPEND _sources
    ../common/error.c
    ../common/pathalloc.c
)

if (COMPILE_ALL)
add_executable(getcputc 01_getcputc.c ${_sources})
add_executable(fgetsfputs 02_fgetsfputs.c ${_sources})
add_executable(buf 03_buf.c ${_sources})
add_executable(tempfiles 04_tempfiles.c ${_sources})

else()
add_executable(mkstemp 05_mkstemp.c ${_sources})
endif()
